<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('组装单')" />
	<th:block th:include="include :: list-css" />
    <style>
        .layui-tab-title{border-color: #ccc !important;}
        .layui-this{color: rgb(0, 135, 250) !important;background: none !important;}
        .layui-tab-brief > .layui-tab-title .layui-this:after, .layui-tab-brief > .layui-tab-more li.layui-this:after{border-color:  rgb(0, 135, 250) !important;}
        .mid-content {overflow: auto;}
    </style>
</head>
<body class="no-skin">
<script type="text/html" id="toolbar">
	<div class="layui-btn-container">
		<div class="layui-btn layui-btn-normal layui-table-tools" lay-event="addbtn" shiro:hasPermission="storage:dismounting:view">
			<i class="dhicon dh-lujing1089"></i> 新增
		</div>
        <div class="layui-btn layui-table-tools costbtn" lay-event="costbtn" onclick="costbtn()" th:if="${extraButton.costbtn}">
			<i class="dhicon dh-random"></i> 拆装费用
        </div>
        <!-- <div class="layui-btn layui-btn-normal layui-table-tools" lay-event="deleteBatch" shiro:hasPermission="storage:dismounting:view">
			<i class="dhicon dh-remove"></i> 删除
		</div> -->
        <div class="layui-btn layui-btn-normal layui-table-tools" lay-event="exportbtn" shiro:hasPermission="storage:dismounting:view">
			<i class="dhicon dh-download"></i> 导出
		</div>
    </div>
</script>

<!-- 表格操作区 -->
<script type="text/html" id="yybl">
	<div class="layui-form layui-card-header layuiadmin-card-header-auto tccon">
		<div class="layui-form-item margin_t0">
            <input  type="hidden"  name="czguid" id="czguid"  th:value="${cost?.guid}" class="layui-input canntEdit" autocomplete="off" readonly/>
	        <div class="layui-inline margin_r0 layui-col-xs12">
	        	<label class="layui-form-label"><font>拆装费用：</font></label>
				<div class="layui-input-block"><input  type="number"  name="dismountingCost" id="dismountingCost" th:value="${cost?.dismountingCost}" class="layui-input" autocomplete="off"/></div>
			</div>
        </div>
	</div>
</script>
<script th:inline="javascript">
    /*<![CDATA[*/
    var gridColumns = [[${gridColumns}]],
        business = [[${storage}]],
        buttonState = [[${buttonState}]],
        businessName = gridColumns.moduleAlias,
        passwordAuthentication = [[${passwordAuthentication}]],
        moduleTable = [[${moduleTable}]]; 
        cost = [[${cost}]]; 
    /*]]>*/
    var prefix = "/storage/"+business;
	var tableUrl = prefix + "/list",
	openRowUrl = "/storage/"+(business.split('/')[1]?business.split('/')[0]:business)+"/edit?nid=";
	exportUrl = prefix + "/export";
	delUrl = prefix+"/delete";
</script>
<th:block th:include="listinclude :: container" />
<th:block th:include="include :: footer" />
<th:block th:include="include :: tableBtn" />
<th:block th:include="listinclude :: list-templeat" />
<th:block th:include="include :: searchJS" />
<th:block th:include="include :: listJS" />

<script type="text/javascript">
    var $,layer,laydate,form,table,wherestr={};
    layui.use(['table','laydate','form','layer','jquery','element'], function () {
        $ = layui.$, layer = layui.layer,laydate = layui.laydate , form = layui.form, table = layui.table, element = layui.element;

        window.costbtn=function (){
            layer.open({
                type: 1,
                content: $('#yybl').html(),
                area: ['350px', '170px'],
                maxmin: true,
                shade: 0.3,
                title: '拆装费用',
                shadeClose: true,
                btn: ['确定', '关闭'],
                yes: function(index, layero){
                    var guid=$('#czguid').val()
                    var dismountingCost=$('#dismountingCost').val()
                    // if(!dismountingCost) return layer.msg('请填写拆装费用')
                    $.post("/storage/othercost/editpost",{'infoItems':JSON.stringify({guid,dismountingCost})},function(res){
                        layer.msg(res.msg)
                        if(res.code==0){
                            location.reload();
                        }
                    });
                }
            });
        }
    
        
     });
    

    
    </script>

</body>
</html>